package com.oyb.servlet;

import com.oyb.service.ClassServies;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/classesdel")
public class ClassesdeleteServlet extends HttpServlet {
    private ClassServies classServies = new ClassServies();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String[] ids = req.getParameterValues("checknames");
        int result = classServies.delclassesbyid(ids);
        if(result>0){
            resp.sendRedirect("classesquerypage");
        }
    }
}
